# Translating the provided MATLAB code to Python
import numpy as np

# Constants and reference values
Rref = 86e3  # reference range in meters
tau_ref = 0.1e-6  # reference pulsewidth in seconds
SNRref = 20.  # Reference SNR in dB
snrref = 10**(SNRref / 10)  # Reference SNR in base 10
Sigmaref = 0.1  # reference RCS in m^2
Lossp = 2  # processing loss in dB
lossp = 10**(Lossp / 10)  # processing loss in base 10

# Desired values
tau = tau_ref  # desired pulsewidth
R = 120e3  # desired range in meters
rangeratio = (Rref / R)**4  # range ratio
Sigma = 0.2  # desired RCS

# Implement Eq. (1.60)
snr = snrref * (tau / tau_ref) * (1. / lossp) * (Sigma / Sigmaref) * rangeratio
snr_db = 10 * np.log10(snr)  # convert SNR to dB

print(f'snr_db: {snr_db};')
